import axios from 'axios'
import store from '@/store'
axios.defaults.baseURL = 'http://120.24.171.137:1337'


//请求拦截器
axios.interceptors.request.use(config => {
    if (store.getters.token) {
        config.headers.Authorization = `Bearer ${store.getters.token}`
    }
    return config
});
// 响应拦截器
axios.interceptors.response.use(config => {
    return config.data
})
export default axios